-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use specialized dictionary kernels (#1178) #2808
Use specialized dictionary kernels (#1178) #2808
Conversation
match (&left_value, &left_data_type, &right_value, &right_data_type) { | ||
// Types are equal => valid | ||
(_, l, _, r) if l == r => {} | ||
// Allow comparing a dictionary value with its corresponding scalar value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually necessary for correctness in addition to being beneficial for performance, because ScalarValue does not have a way to encode a dictionary data type
Unsurprisingly the performance benefits of this are quite pronounced
|
Codecov Report
@@ Coverage Diff @@
## master #2808 +/- ##
==========================================
+ Coverage 85.11% 85.22% +0.11%
==========================================
Files 273 274 +1
Lines 48242 48634 +392
==========================================
+ Hits 41059 41449 +390
- Misses 7183 7185 +2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @tustvold
@@ -155,14 +155,12 @@ pub fn comparison_eq_coercion( | |||
lhs_type: &DataType, | |||
rhs_type: &DataType, | |||
) -> Option<DataType> { | |||
// can't compare dictionaries directly due to | |||
// https://github.com/apache/arrow-rs/issues/1201 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
Which issue does this PR close?
Part of #1178
Rationale for this change
Arrow-rs supports native evaluation on dictionaries for comparison operations against other dictionaries and scalars. We should make use of this to avoid hydrating dictionaries unnecessarily
What changes are included in this PR?
Tweaks the coercion rules to coerce to the dictionary type if supported by the operator
Are there any user-facing changes?
No